/*
 * @author java_deng
 * @date 2025/1/24 15:34
 * @description
 */
package org.kaka.controller;

import org.kaka.po.CommentPo;
import org.kaka.service.impl.CommentServiceImpl;
import org.kaka.vo.CommentVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/comment")
public class CommentController extends BaseController{
    @Autowired
    private CommentServiceImpl commentService;

    @PostMapping("/save")
    public Object save(@RequestBody CommentVo commentVo){
        commentService.save(commentVo);
        return success("发布成功");
    }

    @PostMapping("/list")
    public Object list(@RequestBody CommentPo commentPo){
        List<CommentVo> commentVoList= commentService.list(commentPo);
        return success(commentVoList);
    }
}
